package org.example.project01.controller;

import org.apache.ibatis.annotations.Param;
import org.example.project01.common.PageData;
import org.example.project01.common.ResponseData;
import org.example.project01.domain.GoodsClassify;
import org.example.project01.service.IGoodsClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class GoodsClassifyController {
@Autowired
    private IGoodsClassifyService goodsClassifyService;
@PostMapping("/addGoodsClassify")
public ResponseData<GoodsClassify> addGoods(@RequestBody GoodsClassify goodsClassify)
    {
     return goodsClassifyService.addGoods(goodsClassify);
    }
@DeleteMapping("/deleteGoodsClassify")
public ResponseData<GoodsClassify> deleteGoods(@Param("classifyId") String classifyId)
    {
     return goodsClassifyService.deleteGoods(classifyId);
    }
@PutMapping("/modifyGoodsClassify")
public ResponseData<GoodsClassify> modifyGoods(@RequestBody GoodsClassify goodsClassify)
    {
     return goodsClassifyService.modifyGoods(goodsClassify);
    }
@GetMapping("/getGoodsClassify")
public ResponseData<PageData<GoodsClassify>> getGoods(@Param("classifyId") String classifyId)
    {
     return goodsClassifyService.getGoods(classifyId);
    }
}
